/*
@name: "接口请求",
@date: 2020/12/04
@auther: sy_001
*/
import axios from "axios";
import md5 from "md5";
const url = "/api";
const appid = 20170213000039023;

// 翻译
const fanyi = (query) => {
  const salt = new Date().getTime();
  axios
    .get(url, {
      params: {
        tts: true, // 语音文件
        from: "auto",
        to: "en",
        appid,
        q: query,
        salt,
        sign: md5(appid + query + salt + "6cfHKnulugqruSBdkCGV"),
      },
    })
    .then((res) => {
      console.log(res);
    });
};

export default fanyi;
